<?php if (!defined('THINK_PATH')) exit(); echo W('Template/top');?>
<div class="wrapper clearfix content" style="position: relative;border: 1px solid #ddd">
    <?php echo W('Template/left');?>

    <form class="form-horizontal zcform" id="signupForm" method="post" action="<?php echo U('Product/edit');?>"
          enctype="multipart/form-data">
        <input type="hidden" id="id" value="<?php echo ($list["id"]); ?>">
        <input type="hidden" id="keyid" value="<?php echo (setEncrypt($list["id"])); ?>">
        <input id="editProduct" type="hidden" value="<?php echo U('Product/edit');?>"/>

        <div class="rightbox pull-right">
            <div class="ur-here">您当前的位置：<a href="#">通用产品</a>&gt;<a href="<?php echo U('Product/index',array('id' => 111));?>">通用产品列表</a>&gt;修改通用产品
            </div>
            <div class="cTitle2">修改通用产品</div>

            <div class="panelCon" id="tab-1">

                <div class="form-group">
                    <label class="col-sm-2 control-label">产品名称：</label>

                    <div class="col-sm-8">
                        <input type="text" class="form-control" placeholder="请输入产品名称" name="name" id="name"
                               value="<?php echo ($list["name"]); ?>">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">产品描述：</label>

                    <div class="col-sm-8">
                        <script id="editor1" type="text/plain" name="description"><?php echo ($list["description"]); ?></script>
                    </div>
                </div>
                <div class="form-group priceCost" hidden>
                    <label class="col-sm-2 control-label">成本价格：</label>

                    <div class="col-sm-8">
                        <input type="text" class="form-control" id="price_cost" name="price_cost"
                               placeholder="请输入成本价格" value="<?php echo (getYuan($list["price_cost"])); ?>"></div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">同行价<span class="showPriceCost">：</span></label>

                    <div class="col-sm-8">
                        <input type="text" class="form-control" id="price" name="price" placeholder="请输入同行价"
                               value="<?php echo (getYuan($list["price_agency"])); ?>"></div>
                </div>
                <!--<div class="form-group">-->
                    <!--<label class="col-sm-2 control-label">参数类型：</label>-->

                    <!--<div class="col-sm-8">-->
                        <!--<select name="para_type" id="para_type"-->
                                <!--style="width: 100px;height: 35px;line-height: 35px;border: 1px solid #d0d0d0">-->
                            <!--<?php if($info['para_type'] == 1): ?>-->
                                <!--<option value="<?php echo ($para_type); ?>" checked>保险</option>-->
                                <!--<?php else: ?>-->
                                <!--<option value="">未选择</option>-->
                                <!--<option value="1">保险</option>-->
                            <!--<?php endif; ?>-->
                        <!--</select>-->
                    <!--</div>-->
                <!--</div>-->

                <!--<div class="form-group">-->
                    <!--<label class="col-sm-2 control-label">参数值：</label>-->

                    <!--<div class="col-sm-8">-->
                        <!--<input type="text" id="para_value" class="form-control" name="para_value" placeholder="请输入参数值"-->
                               <!--value="<?php echo ($list["para_value"]); ?>"></div>-->
                <!--</div>-->
            </div>

            <div class="form-group" style="margin-top: -20px;">
                <label class="col-sm-2 control-label" style="margin-left:15px">产品图片：</label>

                <div class="col-sm-8">
                    <tr>
                        <td id="pics">
                            <div class="row" style="margin:10px;">
                                <div class="col-sm-7"><h4 id="uploadMessage"></h4>
                                </div>
                                <div class="col-sm-5">
                                    <div id="filePicker"
                                         class="btn btn-sm btn-primary webuploader-container webuploader-picker">
                                        选择图片
                                    </div>
                                    <input id="btnUploadCtrl" type="button" class="btn btn-sm btn-primary"
                                           value="开始上传"/>
                                </div>
                            </div>
                            <hr style="padding-bottom: 1px;"/>
                            <input type="hidden" id="cover-pic" value="<?php echo ($list["cover_pic"]); ?>"/>

                            <div class="container" style="max-width: 660px;" id="fileList">
                                <?php if(is_array($list['imgs'])): $i = 0; $__LIST__ = $list['imgs'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i; if(!empty($vo['0'])): ?><div id="" class="row upload-item" style="margin-bottom: 10px;"
                                             path="<?php echo ($vo["0"]); ?>" isCover="<?php echo ($vo["1"]); ?>">
                                            <div class="col-sm-2"><img
                                                <?php if($vo['0'] == $list['cover_pic']): ?>class="img-preview img-cover"
                                                    <?php else: ?>
                                                    class="img-preview"<?php endif; ?>
                                                alt="" src="<?php echo (GetRealImageUrl($vo["0"])); ?>">
                                            </div>
                                            <div class="col-sm-8">
                                                <textarea rows="3" class="form-control"
                                                          placeholder="请输入图片描述"><?php echo ($vo["2"]); ?></textarea>
                                            </div>
                                            <div class="col-sm-2">
                                                <div class="dropdown">
                                                    <button data-toggle="dropdown" id="dropdownMenu1"
                                                            class="btn dropdown-toggle" type="button">
                                                        操作
                                                        <span class="caret"></span>
                                                    </button>
                                                    <ul aria-labelledby="dropdownMenu1" role="menu"
                                                        class="dropdown-menu">
                                                        <li role="presentation">
                                                            <a class="move-up" href="#" tabindex="-1"
                                                               role="menuitem">上移</a>
                                                        </li>
                                                        <li role="presentation">
                                                            <a class="move-down" href="#" tabindex="-1"
                                                               role="menuitem">下移</a>
                                                        </li>
                                                        <li role="presentation">
                                                            <a class="setCover" href="javascript:;" tabindex="-1"
                                                               role="menuitem">设为封面</a>
                                                        </li>
                                                        <li role="presentation">
                                                            <a class="removeFile uploaded" href="javascript:;"
                                                               tabindex="-1" role="menuitem">
                                                                移除图片
                                                            </a>
                                                        </li>
                                                    </ul>
                                                </div>
                                                <div class="upload-msg"></div>
                                            </div>
                                        </div><?php endif; endforeach; endif; else: echo "" ;endif; ?>
                            </div>
                        </td>
                    </tr>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" style="margin-left: 15px">产品库存：</label>

                <div class="col-sm-8">
                    <a href="#" data-toggle="tooltip" data-placement="top"
                       title="暂无意义">
                        <input type="number" class="form-control" id="stock" name="stock" placeholder="请输入产品库存"
                               value="<?php echo ($list["stock"]); ?>" style="width: 96%">
                    </a>
                </div>

            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">&nbsp;</label>

                <div class="col-sm-8 text-right">
                    <input type='button' class='btn btn-warning' value='修改' id="saveProductEdit">
                </div>
            </div>
        </div>

</div>
</div>
</form>
</div>
<?php echo W('Template/bottom');?>
<script type="text/javascript" charset="utf-8" src="http://cdn.lydlr.com/public/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="http://cdn.lydlr.com/public/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="http://cdn.lydlr.com/public/ueditor/lang/zh-cn/zh-cn.js"></script>

<script type="text/javascript" src="http://cdn.lydlr.com/public/webuploader-0.1.5/webuploader.js"></script>
<script type="text/javascript" src="http://cdn.lydlr.com/public/js/upload.js?v=2"></script>
<script>
    $(function () {
        $("[data-toggle='tooltip']").tooltip();
    });

    var ue = UE.getEditor('editor1');

    $(".showPriceCost").click(function () {
        $(".priceCost").show();
    });
</script>
</body>
</html>